package com.ym.b2b.buyer.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ym.b2b.buyer.dao.EmCBuyerDao;
import com.ym.b2b.buyer.service.EmCBuyerService;
import com.ym.b2b.buyer.sqlbean.EmCBuyer;
import com.ym.b2b.buyer.sqlbean.SimpleEmCBuyer;
import com.ym.b2b.commons.conf.WebTokenUser;
import com.ym.b2b.commons.controller.BaseController;

@Controller
@RequestMapping("/buyer")
public class EmCBuyerContorller extends BaseController {

    @Autowired
    private EmCBuyerService emCBuyerService;
    @Autowired
    private EmCBuyerDao     emCBuyerDao;

    @RequestMapping("showEmCBuyerDetail.s")
    @ResponseBody
    public SimpleEmCBuyer showEmCBuyerDetail(EmCBuyer emCBuyer, HttpServletRequest req) {
        WebTokenUser t = getWebTokenUser(req);
        emCBuyer.setBuyerCode(t.getBuyerCode());
        SimpleEmCBuyer em = emCBuyerDao.showSimpleEmCBuyerDetail(emCBuyer);
        return em;
    }

}
